package com.dayu.statistics.controller;

import com.dayu.common.core.domain.AjaxResult;
import com.dayu.statistics.service.DyWorkService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;
import java.util.Map;

@RestController
@RequestMapping("/home/work")
public class DyWorkController {

    @Resource
    private DyWorkService workService;


    /*工作台数量获取*/
    @GetMapping("/number")
    public AjaxResult workNumber() {
        return AjaxResult.success(workService.queryWorkNumber());
    }

    @PostMapping("/saleBill")
    public AjaxResult saleBill(@RequestBody Map<String, Object> map) {
        String date = (String) map.get("date");
        return AjaxResult.success(workService.saleBillList(date));
    }

    @PostMapping("/offerBill")
    public AjaxResult offerBill(@RequestBody Map<String, Object> map) {
        String date = (String) map.get("date");
        return AjaxResult.success(workService.offerBillList(date));
    }
}
